<?php

namespace app\api\model;

use app\basic\BaseModel;

class UserCollection extends BaseModel
{
    // 设置表名
    protected $name = 'user_collection';
    
    // 自动时间戳
    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = false;
    protected $deleteTime = false;

    /**
     * 关联用户模型
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    /**
     * 关联文章模型
     */
    public function article()
    {
        return $this->belongsTo(Article::class, 'article_id');
    }
} 